<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <h:head>
        <title>Sistema de Mala-Direta</title>

        <meta content='text/html; charset=UTF-8' http-equiv="Content-Type"/>

        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/css/default.css" />
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/themes/black-tie/skin.css" />
        <link type="text/css" rel="stylesheet" href="#{request.contextPath}/syntaxhighlighter/styles/syntaxhighlighter.css" />
        <ui:insert name="head"></ui:insert>
    </h:head>
    <h:body>
        <h:form>
            <center>	 
                <h2> BEM VINDO AO SISTEMA DE MALA DIRETA</h2>
            </center>
            <p:dialog header="Area restrita"
                      modal="true"
                      closable="false"
                      position="center"
                      widgetVar="modalLogin"
                      minWidth="300"
                      showEffect="slide" 
                      draggable="false"
                      resizable="false"
                      visible="true"
                      width="500">		 

                <center>	 
                    <p:messages id="mensagens" showDetail="true" showSummary="false" />    				 

                    <h:panelGrid columns="2">   		

                        <h:outputLabel value="Login:" style="font-weight:bold;" />
                        <p:inputText id="username" value="#{authenticator.username}" widgetVar="username" size="50" />

                        <h:outputLabel value="Senha:" style="font-weight:bold;" />
                        <p:password id="password" value="#{authenticator.password}" widgetVar="password" size="50" feedback="false" />

                    </h:panelGrid>

                    <br />	

                    <p:commandButton icon="ui-icon-home" type="submit" id="login" action="#{authenticator.login}" value="Entrar" update="mensagens" />		

                </center>

            </p:dialog>
            
            
        </h:form>
        <ui:insert name="status">
            <p:ajaxStatus style="width:64px;height:64px;position:fixed;right:5px;bottom:5px">
                <f:facet name="start">
                    <p:graphicImage value="/images/loading.gif" />
                </f:facet>

                <f:facet name="complete">
                    <h:outputText value="" />
                </f:facet>
            </p:ajaxStatus>
        </ui:insert>

        <ui:insert name="highlight">
            <script language="javascript" src="#{request.contextPath}/syntaxhighlighter/scripts/sh.js"></script>
            <script language="javascript">
                SyntaxHighlighter.all();
            </script>
        </ui:insert>
    </h:body>
</html>
